﻿<span class="itemdisplay">
    <span class="mdi mdi-clock">@Time</span>
</span>

@code {
    const int WordPerMinute = 500;

    [Parameter]
    public Document Document { get; set; }

    private string Time { get; set; }

    protected override void OnParametersSet()
    {
        int time = (int)Document.GetReadTime().TotalMinutes;
        if (time <= 1)
        {
            Time = "1 minute";
        }
        else
        {
            Time = $"{time.ToString()} minutes";
        }
    }
}
